home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Snippets / Development Tools & Languages / DTSCPlusLibrary / Sources / GDevice.h < prev    next >
Encoding:
Text File  |  1993-01-14  |  2.7 KB  |  86 lines  |  [TEXT/MPS ]

  1. /* _________________________________________________________________________________________________________ //
  2.   Copyright © 1992 Apple Computer, Inc. All rights reserved.
  3.   Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
  4.   Originator: Kent Sandvik
  5.   Date: Wednesday, June 3, 1992 10:10:38
  6.   Revision comments are at the end of this file.
  7.   ---
  8.   TGDevice is a GDevice utility class, finding out GDevice information.
  9.   GDevice.h contains the header file information for the TGDevice class.
  10.   _________________________________________________________________________________________________________ */
  11.  
  12. // Declare label for this header file
  13. #ifndef _GDEVICE_
  14. #define _GDEVICE_
  15.  
  16. #ifndef _DTSCPLUSLIBRARY_
  17. #include "DTSCPlusLibrary.h"
  18. #endif
  19.  
  20. //    Toolbox Include Files
  21. #ifndef __TOOLUTILS__
  22. #include <ToolUtils.h>
  23. #endif
  24.  
  25. #ifndef __QUICKDRAW__
  26. #include <Quickdraw.h>
  27. #endif
  28.  
  29.  
  30. // _________________________________________________________________________________________________________ //
  31. //    Class Interface
  32.  
  33. class TGDevice
  34. // TGDevice is a simple information class which will provide GDevice information, style
  35. // base address of the GDevice, the rowbytes information, and the depth of each
  36. // screen connected to the system. It will wrap around at the end of the GDList
  37. // to the first GDevice.
  38. {
  39. public:
  40.     //    CONSTRUCTORS & DESTRUCTORS
  41.     TGDevice();                                    // basic constructor
  42.     virtual~ TGDevice();                        // virtual destructor
  43.  
  44.     //  ITERATORS
  45.     virtual void Next();                        // get next GDevice
  46.     virtual void First();                        // first value
  47.     virtual Boolean Last() const;                // last GDevice?
  48.  
  49.     //    PUBLIC ACCESSORS AND MUTATORS
  50.     virtual Ptr GetBase() const;                // get address to base
  51.     virtual long GetRow() const;                // get N row value
  52.     virtual short GetDepth() const;                // get depth value
  53. protected:
  54.     virtual void GetGDeviceValues();            // get the GDevice values
  55.  
  56. protected:
  57.     //    INITIATION ROUTINES                            
  58.     virtual Boolean IGDevice();                    // initialize needed class information
  59.  
  60. private:
  61.     //    FIELDS
  62.     GDHandle fGDList;                            // the list of GDevices in the system
  63.     GDHandle fFirstGDList;                        // the first one we encounter (used for wrap)
  64.     Boolean fState;                                // state for the class
  65.     Boolean fFirstTime;                            // signals constructor state
  66.     Boolean fLast;                                // used to signal the last entry
  67.     Ptr fBase;                                    // base address of the GDevice
  68.     long fRow;                                    // row information
  69.     short fDepth;                                // depth information
  70. };
  71.  
  72.  
  73. #endif
  74.  
  75. // _________________________________________________________________________________________________________ //
  76.  
  77.  
  78. /*    Change History (most recent last):
  79.   No        Init.    Date        Comment
  80.   1            khs        6/2/92        New file
  81.   2            khs        7/5/92        First decent release
  82.   3            khs        9/7/92        Changed the structure of the classes
  83. */
  84.  
  85.  
  86.